package com.xuxin.pda.presenter;

import com.xuxin.pda.bean.BaseBean;
import com.xuxin.pda.contract.TrashResultContract;
import com.xuxin.pda.model.TrashResultModel;

/**
 * Created by xu_xin
 * Created on 2021/4/27 0027
 */
public class TrashResultPresenter implements TrashResultContract.Presenter {
    private final TrashResultModel model;
    private final TrashResultContract.View view;

    public TrashResultPresenter(TrashResultContract.View view) {
        this.view = view;
        model = new TrashResultModel();
    }

    @Override
    public void deleteTrash(String id) {
        if (null != model) {
            model.deleteTrash(this, id);
        }
    }

    @Override
    public void onSuccess(BaseBean baseBean) {
        if (null != view) {
            view.onSuccess(baseBean);
        }
    }

    /**
     * 以下内容复用
     */
    @Override
    public void onError(BaseBean baseBean) {
        if (null != view) {
            view.onError(baseBean);
        }
    }

    @Override
    public void onComplete() {
        if (null != view) {
            view.onComplete();
        }
    }
}